
	
/*
 * 自动计算表单数据
 */
function calFormItem() {
    var domForm = $('#' + window.formObj.c.id_form);

	var suggestAmount = parseFloat(domForm.find('input[name="suggestAmount"]').val()); // 商品建议价格
	var purchaseAmount = parseFloat(domForm.find('input[name="purchaseAmount"]').val()); // 商品采购价
	var deliveryAmount = parseFloat(domForm.find('input[name="deliveryAmount"]').val()); // 商品配送价

	if((suggestAmount || suggestAmount==0) && (purchaseAmount || purchaseAmount==0) && (deliveryAmount || deliveryAmount==0)
		){
		//商品利润 = 商品建议价格-商品采购价-商品配送价
		var profitAmount = suggestAmount - purchaseAmount - deliveryAmount;
		domForm.find('input[name="profitAmount"]').val(profitAmount.toFixed(2));

		//利润率 = 商品利润/（商品采购价+商品配送价）
		var profitRatio = profitAmount / (purchaseAmount+deliveryAmount);
		domForm.find('input[name="profitRatio"]').val(profitRatio.toFixed(2));

	}

}